<?php
	$product_id = $params[1];
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$color_id	= strip_tags($_POST['color_id']);
		$size_id	= strip_tags($_POST['size_id']);
		$count		= strip_tags($_POST['count']);
		$sql = "INSERT INTO `tbl_product_item` (`item_id`, `product_id`, `color_id`, `size_id`, `count`, `date_add`, `update`) VALUES (NULL, '$product_id', '$color_id', '$size_id', '$count', NOW(), NOW());";
		mysql_query($sql);
		redirect('../');
		exit;
	}
	 
	$colorOptions	= _u(sqlOptions("SELECT `title` AS `label`, `color_id` AS `value` FROM `tbl_color` WHERE `product_id` = '$product_id' ORDER BY `color_id` ASC"),'color');
	$sizeOptions	= _u(sqlOptions("SELECT `title` AS `label`, `size_id` AS `value` FROM `tbl_size` WHERE 1 ORDER BY `size_id` ASC"),'size');
?>